package zuoye_50;

import java.util.Scanner;

//题目：判断一个素数能被几个9整除 
public class Zuoye_045 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int num1=0;
		while(!isPrime(num)){
			System.out.println("输入素数");
			num = sc.nextInt();
		}
		while(num!=0) {
			if(num/9>0) {
				num1++;
			}
			num/=9;
		}
		System.out.println(num1);
	}
	private static boolean isPrime(int m){
        boolean flag = true;
        for(int i=2;i<Math.sqrt(m)+1;i++){
            if(m%i==0){
                flag = false;
                break;
            }
        }
        return flag;
    }
}
